<template>
  <div class="net-rank">
    <template v-for="item in datas" :key="item.id">
      <net-rank-item
        :src="item.coverImgUrl"
        :text="item.name"
        :rankList="item.tracks"
      />
    </template>
  </div>
</template>

<script lang="ts">
import { defineComponent, computed } from 'vue'

import NetRankItem from './rank-item.vue'

import { rankProps } from './props'

import { rankItem } from './config'

export default defineComponent({
  props: rankProps,
  components: {
    NetRankItem
  },
  setup(props) {
    const datas = computed(() => props.datas)
    return {
      datas,
      rankItem
    }
  }
})
</script>

<style scoped lang="less">
.net-rank {
  display: flex;
  width: 100%;
  background: #f5f5f5;
  border: 1px solid #ccc;
  .net-rank-item:nth-child(1) {
    border-right: 1px solid #ccc;
  }
  .net-rank-item:nth-child(2) {
    border-right: 1px solid #ccc;
  }
}
</style>
